package com.ruoyi.pm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.pubfun.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pm.mapper.SaasSupplierMainImportMapper;
import com.ruoyi.pm.domain.SaasSupplierMainImport;
import com.ruoyi.pm.service.ISaasSupplierMainImportService;

/**
 * js方法引入的第三方js库Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-22
 */
@Service
public class SaasSupplierMainImportServiceImpl implements ISaasSupplierMainImportService 
{
    @Autowired
    private SaasSupplierMainImportMapper saasSupplierMainImportMapper;

    /**
     * 查询js方法引入的第三方js库
     * 
     * @param id js方法引入的第三方js库主键
     * @return js方法引入的第三方js库
     */
    @Override
    public SaasSupplierMainImport selectSaasSupplierMainImportById(Long id)
    {
        return saasSupplierMainImportMapper.selectSaasSupplierMainImportById(id);
    }

    /**
     * 查询js方法引入的第三方js库列表
     * 
     * @param saasSupplierMainImport js方法引入的第三方js库
     * @return js方法引入的第三方js库
     */
    @Override
    public List<SaasSupplierMainImport> selectSaasSupplierMainImportList(SaasSupplierMainImport saasSupplierMainImport)
    {
        return saasSupplierMainImportMapper.selectSaasSupplierMainImportList(saasSupplierMainImport);
    }

    /**
     * 新增js方法引入的第三方js库
     * 
     * @param saasSupplierMainImport js方法引入的第三方js库
     * @return 结果
     */
    @Override
    public int insertSaasSupplierMainImport(SaasSupplierMainImport saasSupplierMainImport)
    {
        saasSupplierMainImport.setId(IdWorker.getId());
        saasSupplierMainImport.setCreateBy(SecurityUtils.getUsername());
        saasSupplierMainImport.setCreateTime(DateUtils.getNowDate());
        saasSupplierMainImport.setUpdateBy(SecurityUtils.getUsername());
        saasSupplierMainImport.setUpdateTime(DateUtils.getNowDate());
        return saasSupplierMainImportMapper.insertSaasSupplierMainImport(saasSupplierMainImport);
    }

    /**
     * 修改js方法引入的第三方js库
     * 
     * @param saasSupplierMainImport js方法引入的第三方js库
     * @return 结果
     */
    @Override
    public int updateSaasSupplierMainImport(SaasSupplierMainImport saasSupplierMainImport)
    {
        saasSupplierMainImport.setUpdateBy(SecurityUtils.getUsername());
        saasSupplierMainImport.setUpdateTime(DateUtils.getNowDate());
        return saasSupplierMainImportMapper.updateSaasSupplierMainImport(saasSupplierMainImport);
    }

    /**
     * 批量删除js方法引入的第三方js库
     * 
     * @param ids 需要删除的js方法引入的第三方js库主键
     * @return 结果
     */
    @Override
    public int deleteSaasSupplierMainImportByIds(Long[] ids)
    {
        return saasSupplierMainImportMapper.deleteSaasSupplierMainImportByIds(ids);
    }

    /**
     * 删除js方法引入的第三方js库信息
     * 
     * @param id js方法引入的第三方js库主键
     * @return 结果
     */
    @Override
    public int deleteSaasSupplierMainImportById(Long id)
    {
        return saasSupplierMainImportMapper.deleteSaasSupplierMainImportById(id);
    }
}
